package com.itheima.mapper;

import com.itheima.domain.UmsAdmin;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 后台用户表 Mapper 接口
 * </p>
 *
 * @author zhuguo
 * @since 2022-11-10
 */
public interface UmsAdminMapper extends BaseMapper<UmsAdmin> {

    /**
     * 根据 id 修改状态
     * @param id
     * @param status
     */
    @Update("update ums_admin set status = #{status} where id = #{id}")
    void updateStatusById(@Param("id") Integer id, @Param("status") Integer status);

    /**
     * 根据用户名修改密码
     * @param username
     * @param password
     */
    @Update("update ums_admin set password = #{password} where username = #{username}")
    void updatePasswordByUsername(@Param("username") String username,@Param("password") String password);
}
